<template>
	<view>
		<up-calendar style="height: 1000rpx;border: 1px solid black;" :showTitle="false" color="#ffc001" @close="()=>{
				show=false
					next('changetime')
		}" round="15" monthNum="2" @confirm="(event)=>{
		
			changeanthertime(event)
		
			settcobj({...lasttcobj,...{time:defaultDateMultiple[0]}})
			next('changetime')
		}" :showMark="false" :show="show" mode="single" :defaultDate="lasttcobj.time"></up-calendar>
	</view>
</template>

<script setup lang="ts">
	import { ref } from 'vue'
	defineProps(['next','settcobj','lasttcobj'])
	let show = ref(true)
	const d = new Date();
	const year = d.getFullYear();
	let month = d.getMonth() + 1;
	// month = month < 10 ? `0${month}` : month;
	const date = d.getDate();
	let defaultDateMultiple = [`${year}-${month}-${date}`];
	let changeanthertime = (event) => {
		show.value = false
		defaultDateMultiple[0] = event[0]
		defaultDateMultiple[0] =defaultDateMultiple[0].replace('-0','-')
		defaultDateMultiple[0] =defaultDateMultiple[0].replace('-0','-')
		console.log(defaultDateMultiple[0])
	}
</script>

<style>
</style>